package com.nowcoder.code.hjnc;


import java.util.Scanner;

public class Main {


    public static void main1(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        int i = s.length() - 1;
        while (i >= 0 && s.charAt(i) == ' ') {
            i--;
        }

        int l = 0;
        for (; i >= 0; i--) {
            if (s.charAt(i) == ' ') {
                break;
            }
            l++;
        }
        System.out.print(l);
    }

    //    public static void main(String[] args) throws Exception {
//        InputStream in = System.in;
//        char c = (char) in.read();
//        int l = 0;
//        while (c != '\n' && c != '\r') {
//            if (c == ' ') {
//                l = 0;
//            } else {
//                l++;
//            }
//            c = (char) in.read();
//        }
//        System.out.print(l);
//    }
    public static void main(String[] args) throws Exception {

        StringBuilder sb = new StringBuilder();
        int i;
        while ((i = System.in.read()) != -1) {
            if ((char) i == '\n' || (char) i == '\r') {
                System.out.println(code(sb.toString()));
                sb = new StringBuilder();
            } else {
                sb.append((char) i);
            }
        }
    }


    public static Object code(Object obj) {
        return obj;
    }


}
